package Operate;

import Contact.Contacts;
import Contact.Contactsllist;

import java.util.Scanner;

public class Add implements Operation {
    @Override
    public void Operate(Contactsllist contactsllist) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("输入你想添加的名字：");
        String name=scanner.nextLine();
        System.out.println("输入emil：");
        String emil=scanner.nextLine();
        System.out.println("输入电话：");
        String call=scanner.nextLine();
        System.out.println("输入年龄：");
        int age=scanner.nextInt();
        Contacts contacts=new Contacts(name,age,emil,call);
        int s=contactsllist.getS()+1;
        contactsllist.Add(contacts,s);
    }
}
